import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fluttertoast/fluttertoast.dart';

class ButtonDemoHome extends StatelessWidget {
  const ButtonDemoHome({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("按钮示例"),
      ),
      body: Container(
        alignment: Alignment.center,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            FloatingActionButton(
              onPressed: () {
                Fluttertoast.showToast(msg: "计数累加");
              },
              child: Text("add"),
            ),
            SizedBox(
              height: 12,
            ),
            RaisedButton(
              onPressed: () {
                Fluttertoast.showToast(msg: "RaisedButton");
              },
              child: Text("RaisedButton"),
            ),
            SizedBox(
              height: 12,
            ),
            FlatButton(
                onPressed: () {
                  Fluttertoast.showToast(msg: "FlatButton");
                },
                child: Text("FlatButton")),
            SizedBox(
              height: 12,
            ),
            OutlinedButton(
                onPressed: () {
                  Fluttertoast.showToast(msg: "OutlinedButton");
                },
                child: Text("OutlinedButton")),
            SizedBox(
              height: 12,
            ),
            RaisedButton(
              onPressed: () {
                Fluttertoast.showToast(msg: "同意协议才可以进行下一步操作");
              },
              child: Text(
                "同意协议",
                style: TextStyle(color: Colors.white),
              ),
              color: Colors.orange,
              highlightColor: Colors.orange[700],
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(20)),
            )
          ],
        ),
      ),
    );
  }
}
